
//封装post 与get请求
var methodaxios={

    get:function(obj,url,callback){
        axios.get(url, {params: obj,}).then(function (response) {
                callback(response)
        })
    },
    post:function(obj,url,callback){
        axios.post(obj,url,{
            transformRequest: [ function (data, headers) {
                let str="";
                for (let i in data) {
                    str+=i+"="+data[i]+"&"
                }
                return str;
            }]
        }).then(function (response) {
                callback(response)
        })
    },/*,
    put:function () {
        axios.put(url, params)
            .then(res => {
                resolve(res.data);
                // Loading.service(true).close();
                //  Message({message: '请求成功', type: 'success'});
            })
            .catch(err => {
                reject(err.data)
                // Loading.service(true).close();
                Message({message: '加载失败', type: 'error'});
            })
    }*/

 /*  getcookie:function(name){
        var strcookie = document.cookie;//获取cookie字符串
        var arrcookie = strcookie.split("; ");//分割
            //遍历匹配
        for ( var i = 0; i < arrcookie.length; i++) {
            var arr = arrcookie[i].split("=");
            if (arr[0] == name){
                return arr[1];
            }
        }
        return "";
    }*/
}